<script setup>
import { useRouter } from "vue-router";
import { onMounted, computed, ref } from "vue";
import { useStore } from "vuex";
const store = useStore();

const router = useRouter();
const gobmhd = (id) => {
  store.commit("huodong/SET_HDXQ", id);
  router.push("/bmhd");
};
let houdongList = computed(() => store.state.huodong.houdongList);
</script>

<template>
  <div>
    <!-- 返回首页 -->
    <van-cell title="热门活动" icon="arrow-left" to="/" />
    <van-divider :style="{ borderColor: '#000' }" />

    <!-- 活动内容 -->
      <van-card
        v-for="(item,index) in houdongList"
        :key="index"
        @click="gobmhd(item._id)"
        :title="item.name"
        :thumb="item.avatar"
      >
        <template #footer>
          <van-tag plain type="danger">{{ item.state }}</van-tag>
        </template>
      </van-card>
  </div>
</template>



<style  scoped>
.van-cell {
  font-size: 18px;
}
</style>